﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Media;

namespace AngryNerds
{
    public class Jerk : Target
    {
        Song hitEffect;
        bool effectPlayed = false;

        /// <summary>
        /// Initializes a new Jerk.
        /// </summary>
        /// <param name="angryGame"></param>
        public Jerk(AngryGame angryGame)
            : base(angryGame)
        {
            frameCount = 3; // jerk has 3 frames
        }

        /// <summary>
        /// Load Jerk
        /// </summary>
        protected override void LoadContent()
        {
            objTexture = Content.Load<Texture2D>("HelmetPig");
            hitEffect = Content.Load<Song>(@"seffects\damage");
        }

        /// <summary>
        /// Draws Jerk
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            DrawWithFrame();
        }

        /// <summary>
        /// Update Jerk
        /// </summary>
        /// <param name="gameTime"></param>
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);
        }

        public override void OnCollide()
        {
            if (!effectPlayed)
            {
                MediaPlayer.Play(hitEffect);
                effectPlayed = true;
            }
        }
    }
}
